function [ref_theta] = angleseq_bound(ref_theta)
% 找到跳变的下标;迭代求差弥补
    index = [];
    for i=2:length(ref_theta)
        if (ref_theta(i-1)>0 && ref_theta(i)<0) || (ref_theta(i-1)<0 && ref_theta(i)>0)
            index = [index,i]; % 记录跳变处的索引下标
        end
    end
    
    if isempty(index)==0
        for j=1:length(index)
            key = index(j);
            delta = ref_theta(key-1) - ref_theta(key); % 求跳变差
            % 判断下一个下标是否存在
            if j==length(index)
                ref_theta(key:end) = delta + ref_theta(key:end);
            else
                ref_theta(key:index(j+1)-1) = delta + ref_theta(key:index(j+1)-1);
            end
        end
    end
end

